package net.orange.architecture.db;

/**
 * The operator ("=","<>",">","<"......).
 */
public class Operator {

	public final static int EQUAL = 0;

	public final static int NOT_EQUAL = 1;

	public final static int LARGER_THAN = 2;

	public final static int LESS_THAN = 3;

	public final static int NOT_LARGER_THAN = 4;

	public final static int NOT_LESS_THAN = 5;

	public final static int LIKE = 6;

	public final static int STR_IN = 7;

	public final static int IS_NULL = 8;

	public final static int IS_NOT_NULL = 9;

	public final static int IN_NUM = 10;

	public final static int IN_STR = 11;

	private static String[] opers = { "_", "o_", "l_", "e_", "nl_", "ne_",
			"r_", "i_", "n_", "nn_" };

	private int op;

	/**
	 * @param o
	 *            the operator.
	 */
	public Operator(int o) {
		op = o;
	}

	/**
	 * @return Returns the op.
	 */
	public int getOp() {
		return op;
	}

	/**
	 * @param op
	 *            The op to set.
	 */
	public void setOp(int op) {
		this.op = op;
	}

	/**
	 * Get the opeator abbreviation string.
	 * 
	 * @param op
	 *            The operator
	 * @return The opeator abbreviation string.
	 */
	public static String getOper(int op) {
		return opers[op];
	}
}